Field of the Invention
The present invention relates to an image processing apparatus and a controlling method thereof.
Description of the Related Art
Panning photography is known as a photographic technique for expressing a moving object with a sensation of speed. The panning photography aims to keep the moving object in the same position and allow the background to blur as a photographer pans a camera to follow a motion of the object. In the panning photography, a photographer is required to pan the camera to follow a motion of the object. However, if the panning speed is excessively slow or fast, and a difference is generated between a moving speed of the object and a panning speed, a resulting image may have blurring even on the object.
In order to assist a user to easily obtain a panning shot, a panning shot assist function for absorbing a difference between the moving speed of the object and the panning speed by moving a shift lens has been proposed. In Japanese Patent Laid-Open No. 2006-317848, an imaging apparatus for panning photography is discussed, in which blurring is detected using a gyroscopic sensor, an object is detected from a motion vector of an image, a correction amount for centering the detected object on the image is calculated, and correction is performed by moving an optical-axis shift lens.
As a technique of detecting a motion vector from an image, a method of detecting the motion vector by comparing successively captured images has been proposed. For example, in Japanese Patent Laid-Open No. 08-88855, a device for detecting a motion vector has been discussed, in which pixel values are compared between a reference block and a candidate block serving as block matching targets for detecting a motion vector while a position of the candidate block is shifted within a search area.
In the device disclosed in Japanese Patent Laid-Open No. 2006-317848, motion compensation is performed using the detected motion vector, and the step of detecting the motion vector is then repeated by reducing the search area. However, in this case, if a predominant object (hereinafter, referred to as a “main object”) is smaller than the search area, the motion vector of the background is also detected in addition to the motion vector of the main object. Therefore, it becomes difficult to determine the motion vector of the main object from the detected motion vectors. As a result, it is difficult to accurately obtain an angular velocity of the main object, and the panning shot assist function does not work satisfactorily.